﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.peddlerUI {
    import flash.display.*;
    import org.aswing.*;
    import Classes.*;
    import Classes.util.*;
    import flash.text.*;
    import Modules.peddler.*;
    import Display.aswingui.*;

    public class PeddlerWingToolTipView extends JPanel {

        private var m_supplay:JLabel;
        private var m_bonse:JLabel;
        private var m_harvestTime:JLabel;
        private var m_contentPanel:JPanel;
        private var m_ttbg:DisplayObject;

        public function PeddlerWingToolTipView(_arg1:Boolean=false){
            super(ASwingHelper.softBoxLayoutVertical);
            this.makeBackground(_arg1);
            this.m_contentPanel = this.makeCenterPanel();
            if (_arg1){
                this.appendAll(ASwingHelper.verticalStrut(20), this.m_contentPanel, ASwingHelper.verticalStrut(5));
            } else {
                this.appendAll(this.m_contentPanel, ASwingHelper.verticalStrut(25));
            };
            ASwingHelper.prepare(this);
            this.setPreferredWidth(this.m_ttbg.width);
        }
        protected function makeBackground(_arg1:Boolean=false):void{
            if (false == _arg1){
                this.m_ttbg = (new EmbeddedArt.mkt_pop_info() as DisplayObject);
            } else {
                this.m_ttbg = (new EmbeddedArt.peddlerBG() as DisplayObject);
            };
            this.setBackgroundDecorator(new AssetBackground(this.m_ttbg));
        }
        protected function makeCenterPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical();
            _local1.append(this.makeLongContentPanel());
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        protected function makeLongContentPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP);
            var _local2:TextFormat = new TextFormat();
            _local2.align = TextFormatAlign.LEFT;
            var _local3:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            var _local4:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            var _local5:JLabel = ASwingHelper.makeLabel(ZLoc.t("Dialogs", "Peddler_WingToolTip_Good"), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, 4168133, JLabel.LEFT);
            _local4.appendAll(ASwingHelper.horizontalStrut(5), _local5);
            var _local6:AssetPane = new AssetPane((new EmbeddedArt.smallGoodsIcon() as DisplayObject));
            this.m_supplay = ASwingHelper.makeLabel("xxxx", EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
            _local3.appendAll(ASwingHelper.horizontalStrut(10), _local6, this.m_supplay);
            ASwingHelper.prepare(_local3);
            var _local7:JLabel = ASwingHelper.makeLabel(ZLoc.t("Dialogs", "Peddler_WingToolTip_Bonse"), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, 4168133, JLabel.LEFT);
            var _local8:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            _local8.appendAll(ASwingHelper.horizontalStrut(5), _local7);
            var _local9:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            var _local10:AssetPane = new AssetPane((new EmbeddedArt.mkt_coinIcon() as DisplayObject));
            this.m_bonse = ASwingHelper.makeLabel("xxxx", EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
            _local9.appendAll(ASwingHelper.horizontalStrut(10), _local10, this.m_bonse);
            ASwingHelper.prepare(_local9);
            var _local11:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            var _local12:JLabel = ASwingHelper.makeLabel(ZLoc.t("Dialogs", "Peddler_WingToolTip_Time"), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, 4168133, JLabel.LEFT);
            var _local13:JPanel = ASwingHelper.makeFlowJPanel(FlowLayout.LEFT);
            _local13.appendAll(ASwingHelper.horizontalStrut(5), _local12);
            var _local14:AssetPane = new AssetPane((new EmbeddedArt.timerIcon() as DisplayObject));
            this.m_harvestTime = ASwingHelper.makeLabel("xxxx", EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, EmbeddedArt.blueTextColor, JLabel.LEFT);
            _local11.appendAll(ASwingHelper.horizontalStrut(10), _local14, this.m_harvestTime);
            ASwingHelper.prepare(_local11);
            _local1.appendAll(ASwingHelper.verticalStrut(5), _local4, _local3, _local8, _local9, _local13, _local11, ASwingHelper.verticalStrut(5));
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        public function setUpDataForView(_arg1:Object):void{
            var _local2:PeddlerModel = (_arg1 as PeddlerModel);
            this.m_supplay.setText(String(_local2.item.commodityReq));
            this.m_bonse.setText(String(_local2.item.coinYield));
            var _local3:Number = Global.gameSettings.getNumber("inGameDaySeconds");
            var _local4:Number = (_local2.item.expireTime * _local3);
            var _local5:String = GameUtil.formatMinutesSeconds(_local4);
            this.m_harvestTime.setText(String(_local5));
        }

    }
}//package Display.peddlerUI 
